import {
  TouchableOpacity,
  GestureResponderEvent,
  StyleSheet,
} from 'react-native';
import React, {ReactNode} from 'react';
import {ObserverText, ObserverTextProps} from './ObserverText';

interface ObserverButtonProps extends Omit<ObserverTextProps, 'type'> {
  type: 'more' | 'primary' | 'link';
  onPress?: ((event: GestureResponderEvent) => void) | undefined;
  before?: ReactNode;
}

export const ObserverButton = (props: ObserverButtonProps) => {
  const {onPress, type, ...rest} = props;

  return (
    <TouchableOpacity onPress={onPress}>
      <ObserverText type={`btn-${type}`} {...rest} />
    </TouchableOpacity>
  );
};
